<div class="row">
  <small>
 <div class="span3 bs-docs-sidebar ">
 	<*include file="<*$controller*>/location.tpl"*>
  </div>
  <div class="span9">
   <div class="clearfix txtleft search" style="background-color:#f8f8f8; padding:10px; margin:10px 0px;"> 
      <form action="/<*$controller*>/index" method="get" class="form-horizontal" name="form1">       
		  机构:<select id="jigou" name="groups"  onchange="getSchool(this.value)"></select>
          校园:<select id="school" name="school"  ></select> 
         <input type="submit" class="btn btn-success"  value="查询"  >
         <input type="button" class="btn btn-success" value="清空查询" onclick="window.location='/<*$controller*>/<*$action*>'" >
      </form>
	</div>	
     <style> 
.clearfix:after {
    clear: both;
    content: ".";
    display: block;
    height: 0;
    overflow: hidden;
    visibility: hidden;
}

ul {
    list-style: none outside none;
}
li {
    list-style-type: none;
}
</style>
    <form  action="/<*$controller*>/op" method="post" enctype="multipart/form-data" class="form-horizontal"> 
      
       <div class="control-group">
        <label class="control-label inline" >选择班级</label>
        <div class="controls">
          <*if $classlist|@count neq 0*>  
            <div  class="span8">
                  <ul class="span8" >
                    <*foreach from=$classlist item=a key =key*>
                      <li   class="span2">
                       <label class="checkbox inline">
                            <input type="checkbox" name="class[]" id="class<*$a.classid*>" value="<*$a.uid*>"  <*if $result.type eq 1*> checked <*/if*>><*$a.classname*></label> 
                       </li>
                    <*/foreach*>
                    </ul> 
                 </div>  
            <*else*>     
          
          <span style="color:#F00">  请先选择机构、校区！</span>
                 
           <*/if*>     
        </div>
      </div> 
      
      <!--  <div class="control-group">
        <label class="control-label" for="version_no">积分值</label>
        <div class="controls">
            <input type="text"  name="score"   placeholder="例如：20"/>
        </div>
      </div>-->
       
      <div class="control-group">
        <label class="control-label" for="version_no"></label>
        <div class="controls"> 
         <div class="tabbable"> 
         <!-- Only required for left/right tabs -->
          <ul class="nav nav-tabs">
            <li class="active"><a href="#tab1" data-toggle="tab">增加积分说明</a></li>
            <li><a href="#tab2" data-toggle="tab">增加绩效</a></li>
          </ul>
          
          <div class="tab-content">
            <div class="tab-pane active" id="tab1">
              <p> <label class="radio inline">
       		 <input type="radio" name="optionsRadios" id="optionsRadios1" value="publicize"  <*if $result.type eq 1*> checked <*/if*>> 推荐积分
        </label> 
        <label class="radio inline">
       		  <input type="radio" name="optionsRadios" id="optionsRadios1" value="year"  <*if $result.type eq 2*> checked <*/if*>>  年vip积分
        </label>
        <label class="radio inline">
       		<input type="radio" name="optionsRadios" id="optionsRadios1" value="term"   <*if $result.type eq 3*> checked <*/if*> > 学期vip积分
        </label>  </p>
            </div>
            <div class="tab-pane" id="tab2">
              <p> <label class="control-label" for="version_no">积分值</label>
         
                <input type="text"  name="score"   placeholder="例如：20"/>
             </p>
            </div>
          </div>
        </div> 
        
        </div>
      </div>
         <div class="control-group"> 
         <div class="controls">
          <input type="hidden" name="groups" value="<*$groups*>" ></input>
           <input type="hidden" name="schoolid" value="<*$schoolid*>" ></input>
          <button class="btn btn-primary" type="submit">提交</button>
          <button class="btn" type="button">返回</button>
          </div>
      </div>
   </form>   
         
   </div>
   </small>
      </div> 
<script type="text/javascript" src="/js/prototype.js"></script>
<script type="text/javascript">
 
  window.onload=function(){
	 jigou(); 

	if('<*$groups*>' != ''){
		getSchool('<*$groups*>');
	}
	if('<*$school*>' != ''){
		getClass('<*$school*>');
	}

 } 
function jigou()
{  

	var url     = '/<*$controller*>/groups/'; 
	//var pars = '&classname=' + classname +'&name=' + name+'&studentno=' + studentno +'&attend=' + attend + '&leave=' + leave + '&reason=' + reason;
	var pars = '';
	var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete:showResponse_course});

} 
function showResponse_course(originalRequest)
{
	{  //alert(originalRequest.responseText);  
		 document.all.form1.groups.innerHTML='<option value="0" >==请选择==</option>'+originalRequest.responseText;
		  if('<*$groups*>' != ''){
			 jsSelectIsExitItem(document.all.form1.groups,'<*$groups*>');
	        } 
	 }

}  

function getSchool(a)
{  
	var url  = '/<*$controller*>/schoollist/'; 
	//var pars = '&classname=' + classname +'&name=' + name+'&studentno=' + studentno +'&attend=' + attend + '&leave=' + leave + '&reason=' + reason;
	var pars = '&id=' + a;
	var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete:showResponse_school});

} 
function showResponse_school(originalRequest)
{
	{    //alert(originalRequest.responseText);  
		 document.all.form1.school.innerHTML='<option value="0" >==请选择==</option>'+originalRequest.responseText;
		  if('<*$school*>' != ''){
				jsSelectIsExitItem(document.all.form1.school,'<*$school*>');
			}
	 } 
}  
function getClass(a)
{  
     
	var url  = '/<*$controller*>/classlist/'; 
	//var pars = '&classname=' + classname +'&name=' + name+'&studentno=' + studentno +'&attend=' + attend + '&leave=' + leave + '&reason=' + reason;
	var pars = '&id=' + a;
	var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete:showResponse_class});

} 
function showResponse_class(originalRequest)
{
	{    //alert(originalRequest.responseText);  
		 document.all.form1.class.innerHTML='<option value="0" >==请选择==</option>'+originalRequest.responseText;
		  if('<*$classid*>' != ''){
				jsSelectIsExitItem(document.all.form1.class,'<*$classid*>');
			}
	 } 
}  

function deleteit(id,type)
{
  if(confirm("删除将不能恢复")){
   window.location='/<*$controller*>/delete/id/'+id+'/type/'+type;
   }
}

function editit(id,pageNum)
{ 
 	window.location='/<*$controller*>/editstudent/id/'+id+'/pageNum/'+pageNum;
}
 
 function jsSelectIsExitItem(objSelect, objItemValue) {
	//alert(objSelect.options.length);
    for (var i = 0; i < objSelect.options.length; i++) {
        if (objSelect.options[i].value == objItemValue) { 
			objSelect.options[i].selected=true;
        	 break;
        }
    }
    return 1;
}  
 
</script>
